package cn.senjoeson.timedowner.dao;

import android.content.Context;
import android.database.Cursor;

import cn.senjoeson.timedowner.bean.HeartList;

/**
 * @author Android
 * @date 2017/12/28
 */

public class HeartListDao extends BaseDao<HeartList> {
    /**
     * @param context    上下文
     * @param TABLE_NAME 表名
     */
    public HeartListDao(Context context, String TABLE_NAME) {
        super(context, TABLE_NAME);
    }

    @Override
    protected String createTableExce() {
        return DBConfig.CREATE_TABLE_TITLE;
    }

    @Override
    public HeartList getSingleData(Cursor cursor) {
        HeartList heartList = new HeartList();
        long id = cursor.getLong(0);
        String title = cursor.getString(1);
        heartList.setId(id);
        heartList.setTitle(title);
        return heartList;
    }

    @Override
    protected String setUniqueField() {
        return "titleid";
    }
}
